package com.starlink.model.util;

import com.starlink.model.dtomapper.SchoolbagOrderDtoMapper;
import com.starlink.model.domain.SchoolbagOrderDO;
import com.starlink.model.vo.SchoolbagOrderVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class SchoolbagOrderConvert {

    public static List<SchoolbagOrderVO> buildSchoolbagOrderVoList(List<SchoolbagOrderDO> schoolbagOrderDOList) {
        if (CollectionUtils.isEmpty(schoolbagOrderDOList)) {
            return Lists.newArrayList();
        }
        List<SchoolbagOrderVO> schoolbagOrderVOList = new ArrayList<>();
        for (SchoolbagOrderDO schoolbagOrderDO : schoolbagOrderDOList) {
            schoolbagOrderVOList.add(SchoolbagOrderDtoMapper.INSTANCE.do2VO(schoolbagOrderDO));
        }

        return schoolbagOrderVOList;
    }
}
